package com.ruoyi.behindDoctor.controller;

import com.ruoyi.behindDoctor.domain.yDocTeam;
import com.ruoyi.behindDoctor.service.IyDocTeamService;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController
@RequestMapping("/behindDoctor/team")
public class yDocTeamController {

    @Autowired
    private IyDocTeamService teamService;

    /**
     * 获取所有团队下拉数据
     */
    @GetMapping("/dropdown")
    public AjaxResult getTeamDropdown() {
        List<yDocTeam> teams = teamService.getAllTeams();
        return AjaxResult.success(teams);
    }

    /**
     * 根据ID查询团队详情
     */
    @GetMapping("/{teamId}")
    public AjaxResult getTeamById(@PathVariable Integer teamId) {
        yDocTeam team = teamService.getTeamById(teamId);
        return AjaxResult.success(team);
    }
}
